<template>
    <el-dialog
      :title="title"
      :close-on-click-modal="false"
      :visible.sync="visible"
      :before-close="cancel"
      class="JNPF-dialog JNPF-dialog_center"
      lock-scroll
      width="40%"
    >
      <el-row :gutter="15" class="">
        <el-form
          ref="elForm"
          :model="dataForm"
          :rules="rules"
          label-width="100px"
        >
          <el-col :span="24">
            <el-form-item label="报到单号" class="required" prop="FBILLNO">
              <el-input
                v-model="dataForm.FBILLNO"
                placeholder="请输入"
                clearable
                :disabled="!insertorupdate"
                maxlength="8"
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="24">
            <el-form-item class="required" label="研学单号" prop="FSRCNO">
              <el-input
                v-model="dataForm.FSRCNO"
                placeholder="请输入"
                clearable
                :style="{ width: '100%' }"
              >
              </el-input>
            </el-form-item>
          </el-col>

          <el-col :span="24">
          <el-form-item class="required" label="学校名称" prop="FSCHOOL">
            <el-input
              v-model="dataForm.FSCHOOL"
              placeholder="请输入"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="课程名称">
            <el-input
              v-model="dataForm.FCATNAME"
              placeholder="请输入"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="身份证号">
            <el-input
              v-model="dataForm.FCATNO"
              placeholder="请输入"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="学生姓名">
            <el-input
              v-model="dataForm.FUSER"
              placeholder="请输入"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="报到时间">
            <el-input
              v-model="dataForm.FTIME"
              placeholder="请输入"
              clearable
              :style="{ width: '100%' }"
            >
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <el-form-item label="经纬度">
            <el-image
              style="width: 250px; height: 230px"
              :src="url"
              :fit="fit"></el-image>
          </el-form-item>
        </el-col>

        

        </el-form>
      </el-row>
      <span slot="footer" class="dialog-footer">
        <!-- <el-button @click="cancel">取 消</el-button> -->
        <el-button  v-if="insertorupdate" type="primary" v-loading="loading" @click="cancel">确 定</el-button>
        <el-button  v-else type="primary"  v-loading="loading" @click="cancel">确 定</el-button>
      </span>
    </el-dialog>
  </template>
  <script>
  import jnpf from "@/utils/jnpf"
  export default {
    props: {
      parelist: {
        type: Array,
        default: []
      },
    },
    data() {
      return {
          title:"新增",
          options1: [{
            value: '20E01',
            label: '北京市'
          }, {
            value: '20E02',
            label: '上海市'
          }, {
            value: '20N01',
            label: '天津市'
          }, {
            value: '20N02',
            label: '重庆市'
          }],

        options2: [{
            value: '20E01',
            label: '省'
          }, {
            value: '20E02',
            label: '市/区'
          }, {
            value: '20N01',
            label: '县'
          }],

          dataForm:{
            FBILLNO:"D241130001",
            FSRCNO:"Y241130001",
            FUSER: "大乔",
            FCATNO:"3205691236865980",
            FCATNAME: "上海博物馆研学",
            FSCHOOL: "闵行春申小学",
            FTIME:"2025-03-10 19:00:08",
            FTYPE:"省",
            FSEQNO: 2,
            FVISIBLE: 2,
            FIMAGE: null,
            FOPERATOR: "system",
            FUPDDATE: "2011-02-16T02:57:02.000+00:00"
          },
          rules: {
            FCATNO: [
                  { required: true, message: '请输入职务编号', trigger: 'blur' },
              ],
              FCATNAME: [
                  { required: true, message: '请输入职务名称', trigger: 'blur' },
              ],
          },
        fvisiblelist:[
          {id:"1",fullName:"是"},
          {id:"2",fullName:"否"},
        ],
        loading:false,
        visible:false,
        insertorupdate:true
      };
    },
    created() {
    },
    mounted() {},
    methods: {
      //
      init(id){
        this.dataForm.FCATNO= id || ''
          if(this.dataForm.FCATNO)
          {
              this.title="修改"
             this.insertorupdate=false;
          }
          else
          {
            this.insertorupdate=true;
              this.title="新增";
          }
          this.visible=true;
      },
      //
      cancel(){
          this.$refs.elForm.resetFields();
          this.visible=false;
      },
    },
  };
  </script>
